package com.zhu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhu.domain.enums.OperationEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author JoyBoy
 * @since 2022-06-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class InventoryRecord extends Model<InventoryRecord> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "record_id", type = IdType.AUTO)
    private Integer recordId;

    private String rid;

    private String warehouseName;

    private String realName;

    private String source;

    private String remark;

    private OperationEnum operation;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date time;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Boolean deleted;


    @Override
    protected Serializable pkVal() {
        return this.recordId;
    }

}
